
#include <BRender>
#include "member_BViewer.h"
#include "member_BHandler.h"
#include "member_BCamera.h"

using namespace BWE;

member_BViewer::member_BViewer(BViewer* viewer)
{
	boss = viewer;
}
member_BViewer::~member_BViewer()
{

}

void member_BViewer::paintHandler(BHandler* handler, BPainter& painter)
{
	if (handler && handler->enabled())
	{
		handler_member(handler)->paint(painter);
		for (int i = 0; i < handler_member(handler)->children.size(); i++)
		{
			BHandler* child = handler_member(handler)->children[i];
			paintHandler(child, painter);
		}
	}
}

void member_BViewer::slotCameraChanged(BObject* object)
{
	if (camera == object)
	{
		camera_member(camera)->refresh = true;
		boss->fresh();
	}
}
void member_BViewer::slotCameraFreshed(BObject* object)
{
	if (camera == object)
	{
		camera_member(camera)->refresh = true;
		boss->fresh();
	}
}
void member_BViewer::slotSceneFreshed(BObject* object)
{
	if (camera)
	{
		camera_member(camera)->refresh = true;
		boss->fresh();
	}
}
